#@layout()
#define css()
#define script()
#@layout_script?()
<script>
    function doSubmit() {
        ajaxSubmit("#form", function (data) {
            $("#entryId").attr("value", data.id);
            toastr.success('内容保存成功。');
        })
    }

    $("#submit").on("click", function () {
        doSubmit();
    })
</script>
#end


#define content()
    <section class="content-header">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6">

                    <div class="row mb-2">
                        <div class="col-sm-12">
                            <h1>
                                编辑/新增
                                <small data-toggle="tooltip" title="" data-placement="right"
                                       data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
                                <small> 首页 / 商品评论 / 编辑新增</small>
                            </h1>
                        </div>
                    </div>
                </div>
            </div>

        </div><!-- /.container-fluid -->
    </section>

    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">

                    <form class=" form-setting" autocomplete="off"
                          action="/admin/product_comment/doSave"
                          method="POST" id="form">

                        <div class="card-body">
                            <input type="hidden" id="entryId" name="productComment.id" value="#(productComment.id ??)">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">评论的作者</label>
                                <div class="col-sm-6">

                                    <input type="input" name="productComment.author" class="form-control"
                                           value="#(productComment.author ??)"
                                           placeholder="">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">评论的内容</label>
                                <div class="col-sm-6">

                                    <input type="input" name="productComment.content" class="form-control"
                                           value="#(productComment.content ??)"
                                           placeholder="">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">评论的回复数量</label>
                                <div class="col-sm-6">

                                    <input type="input" name="productComment.reply_count" class="form-control"
                                           value="#(productComment.reply_count ??)"
                                           placeholder="">
                                </div>
                            </div>


                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">“顶”的数量</label>
                                <div class="col-sm-6">

                                    <input type="input" name="productComment.vote_up" class="form-control"
                                           value="#(productComment.vote_up ??)"
                                           placeholder="">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">“踩”的数量</label>
                                <div class="col-sm-6">

                                    <input type="input" name="productComment.vote_down" class="form-control"
                                           value="#(productComment.vote_down ??)"
                                           placeholder="">
                                </div>
                            </div>
							<div class="form-group row">
								<label class="col-sm-2 col-form-label">状态</label>

								<div class="col-sm-6">
									<select class="form-control" name="productComment.status">
										<option value="1" #selectedIf(productComment && productComment.status==1)>正常
										</option>
										<option value="2" #selectedIf(productComment && productComment.status==2)>
											冻结
										</option>
										<option value="3" #selectedIf(productComment && productComment.status==3)>垃圾箱
										</option>
									</select>
								</div>

							</div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">评论的时间</label>
                                <div class="col-sm-6">
                                    <input type="input" class="form-control datetime" placeholder="点击选择"
                                           name="productComment.created"
                                           value="#date(productComment.created)">
                                </div>
                            </div>

                        </div>
                        <!-- /.card-body -->
                        <div class="card-footer">
                            <div class="offset-sm-2 col-sm-10 submit-block">
                                <div class="card-submit">
                                    <button id="submit" type="button" class="btn btn-primary">提交</button>
                                </div>
                            </div>
                        </div>
                        <!-- /.card-footer -->
                    </form>
                </div>
            </div>

    </section>

#end